import request from "@/utils/request.js";

export class RoleService {
    static getRoleList(query) {
        return request({
            url: '/api/system/role/list',
            method: 'get',
            params: query
        })
    }

    static addRole(data) {
        return request({
            url: '/api/system/role/add',
            method: 'post',
            data: data
        })
    }

    static getRole(roleId) {
        return request({
            url: '/api/system/role/' + roleId,
            method: 'get'
        })
    }

    static updateRole(data) {
        return request({
            url: '/api/system/role',
            method: 'put',
            data: data
        })
    }

    static deleteRole(roleId){
        return request({
            url:'/api/system/role/'+roleId,
            method:'delete'
        })
    }

    static allRole(){
        return request({
            url:'/api/system/role/allRoleList',
            method:'get'
        })
    }
}
